import request from "@/utils/request"

/**
 * 管理员登陆
 * @param {*} params 
 * @returns 
 */
export function adminUserLogin(params) {
    return request({
        url: "/admin/administrators/login",
        method: 'post',
        data: params
    }).then(res => {
        console.log(res)
        return res
    })
}

/**
 * 设置昵称
 * @param {*} params 
 * @returns 
 */
export function adminSetNickName(params) {
    return request({
        url: "/admin/administrators/update/nickname",
        method: 'post',
        data: params
    })
}

/**
 * 设置头像
 * @param {*} params 
 * @returns 
 */
export function adminSetAvatar(params) {
    return request({
        url: "/admin/administrators/update/avatarUrl",
        method: 'post',
        data: params
    })
}

/**
 * 设置密码
 * @param {*} params 
 * @returns 
 */
export function adminSetPassword(params) {
    return request({
        url: "/admin/administrators/update/password",
        method: 'post',
        data: params
    })
}

/**
 * 查询管理员列表
 * @param {*} params 
 * @returns 
 */
export function adminList(params) {
    return request({
        url: "/admin/administrators/list",
        method: 'post',
        data: params
    })
}

/**
 * 编辑管理员
 * @param {*} params 
 * @returns 
 */
export function adminEdit(params){
    return request({
        url: "/admin/administrators/update/info",
        method: 'post',
        data: params
    })
}